home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Information
/
alt-sources-mac-digest-94-04.tx
< prev
next >
Wrap
Internet Message Format
|
1994-06-09
|
25KB
Date: Fri, 01 Apr 1994 15:43:49 -0600
From: dnebing@andy.bgsu.edu (Dave Nebinger)
Subject: Alt.sources.mac Digest #4
alt.sources.mac digest #4-94 4/1/94
Today's Contents:
[!] administrivia
[*] backinuse.cpt.hqx
[*] cwjumptable.cpt.hqx
[*] findiconlib.cpt.hqx
[*] fontshow1.1.2.cpt.hqx
[*] fractarcontours.cpt.hqx
[*] gammafadelib.cpt.hqx
[*] glypha3.cpt.hqx
[*] glypha3.1.cpt.hqx
[*] mycard.cpt.hqx
[*] pictbuttoncdef.cpt.hqx
[*] popupcdef1.0b3.cpt.hqx
[*] progresscdef1.0.cpt.hqx
[*] progresscdef1.1.cpt.hqx
[*] stellaobscura.cpt.hqx
[*] textdim.cpt.hqx
[*] threadlib.cpt.hqx
[*] tonedialer.cpt.hqx
[*] trenchsim.cpt.hqx
[*] updnarrowcdef.cpt.hqx
[*] updncntl.cpt.hqx
[*] updncntl2.cpt.hqx
[#] adjwindfkey
[#] appletalktoggle
[#] findfullpath
[#] fswritete
[#] getfindericon
[#] loadcoderes
[#] loadcoderes2
[#] mycopybits
[#] paslibinsymc
[#] polymaze
[#] pswdfilter
[#] queenxlisp
[#] strptime
[#] timezonestuff
[#] tokenizer
[!] Who's Who List
The alt.sources.mac archive is at ftpbio.bgsu.edu
(129.1.252.66) in the /ftp/pub/alt.sources.mac directory.
Files listed with an [*] before them are in the main
directory. Files listed with an [#] in front of them
are in the /ftp/pub/alt.sources.mac/00snippet directory.
Scripts are stored in the /ftp/pub/alt.sources.mac/scripts
directory.
Also stored at the archive site are the FAQs for the
Mac newsgroups in the /ftp/pub directory. Postings to
comp.sources.mac are archived in the /ftp/pub/comp.sources.mac
directory. The alt.sources.mac digests are archived in the
/ftp/pub/digests directory.
The alt.sources.mac newsgroup is for the distribution of
sources only.
************************************************************
From: dnebing@andy.bgsu.edu (Dave Nebinger)
Subject: Administrivia
Welcome to the alt.sources.mac digest. Currently, I am
the moderator of the archive. I thought I would post this
message to show everyone what has been accumulating at the
archive site.
Your contributions are highly recommended and accepted.
If you don't have access to the alt.sources.mac newsgroup,
you can email your contribution to me (dnebing@andy.bgsu.edu)
and I will add it to the archive, or you can upload it to
the /ftp/pub/incoming directory at the archive site.
I would also recommend to those programmers posting
snippets to the comp.sys.mac.* heirarchy to also crosspost
them to the alt.sources.mac group so that I can make sure
that it gets added to the archive.
If anything is missing from the archive that you feel should
be in there, let me know. I am hoping to make the archive the
largest Mac/PPC source code site around...
Thanks for your support, and if you have any questions,
problems, or maladjustments, feel free to email me. Also, let
me know if you have any problems accessing the archive. The only
way I can fix things is if I am told... ;-)
Dave Nebinger (dnebing@andy.bgsu.edu)
************************************************************
From: kenlong@netcom.com (Ken Long)
Subject: BackInUse (C)
This is an old source I found on BMUG and updated to run on Think C.
It draws a 6 point poly, but not by the usual method, then insets the
points a certain amount and redrawing until it gets to nothing. Then
erases and starts over. All B/W. It was called "InUse" hence the name.
It was intended as a screen saver (InUse meaning not in use, or idle).
Enjoy!
-Ken-
[archived as: /ftp/pub/alt.sources.mac/backinuse.cpt.hqx]
============================================================
From: arentz@batcave.knoware.nl (Stefan Arentz)
Subject: CWJumpTable.txt
CWJumpTable - Written by Stefan Arentz, 17/03/94
This Macsbug extension dumps the Jump table of an application that was
build with CodeWarrior C/C++ or Pascal (for 68K of course). It seems that
CodeWarrior doesn't use the standard jump table as described in Inside Mac,
so I wrote this dcmd. Codewarrior is still under development, so things
could change...
Happy MacHacking,
-- Stefan Arentz, arentz@knoware.nl
[archived as: /ftp/pub/alt.sources.mac/cwjumptable.cpt.hqx]
============================================================
From: walkerj@math.scarolina.edu (Jim Walker)
Subject: FindIcon 3/26/94 library (C)
These routines find an icon family for an arbitrary object in the
Mac file system. It is intended to be the same icon displayed by
the Finder, but there are a bunch of exceptions and I can't swear
I found them all. (Still not done: icons from old-style Desktop
files.) THINK C source code. Assumes recent Apple headers, possibly more
recent than those supplied by Symantec.
Freeware by James W. Walker.
[archived as: /ftp/pub/alt.sources.mac/findiconlib.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: FontShow1.1.2
This is a font display/printing project. I found the .c and .h files on
the net, but no .rsrc. but I found a built app. somewhere and got it
running.
Not extensively tested by me - just checked a few normal aspects of it
and it seemed fine on my LC.
A 1989 project by Rainer Fuch.
-Ken-
[archived as: /ftp/pub/alt.sources.mac/fontshow1.1.2.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: Fractar Contours (C)
This is an old B/W fractal program. Very primative and simple. I got it
running on My LC in Think C, but that's as far as I took it.
Enjoy!
-Ken-
[archived as: /ftp/pub/alt.sources.mac/fractarcontours.cpt.hqx]
============================================================
From: Matt Slot <fprefect@engin.umich.edu>
Subject: Gamma Fading Library (THINK C)
This library is intended as a general tool for manipulating the Gamma
Tables
of Graphics Devices, to ramp them up or down in order to achieve smooth
screen fades. The source is included for programmers who want to convert
the library to A4-based, but it is not commented for public consumption.
The library defines 2 globals to save state data, but the entire Table
manipulation is performed with unlocked handles to be easy on your heap.
The typical memory chunk is about 600 bytes for a 13" Monitor in 8-bit
depth, or about 1700 bytes for one in 24-bit color. Usage will vary.
Of course, the Classic Mac cannot use Gamma Fades, only Mac II or later
machines
with attached monitors. (I don't know about the Color Classic tho'!).
Also,
GDevice manipulation needs to follow InitGraf() & InitWindows() calls.
Please use the listed functions to see if you can use this code before you
set
it up. As usual, this stuff is not warranteed, guaranteed, or anything--
use it at your own risk. It is not Apple-recommended for anything, but it
worked for me, so there!
Matt Slot, fprefect@engin.umich.edu
[archived as: /ftp/pub/alt.sources.mac/gammafadelib.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: Glypha.3.pas
This is John Calhoun's B/W Glypha Pascal source. C programmers should
get this one because there's an excellent illustrated info sheet in the
file on copying bits and masks.
I downloaded this a year ago, but haven't seen it on the net - so here it
is!
-Ken-
[archived as: /ftp/pub/alt.sources.mac/glypha3.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: GlyphII.1.1.pas
This is the color version of John Calhoun's Glypha (Pascal source). It's
a 640x480 monitor or bigger program.
-Ken-
[archived as: /ftp/pub/alt.sources.mac/glypha3.1.cpt.hqx]
============================================================
[Moderator's note: the color patches posted to alt.sources.mac have been
included in this archive (I really hate sites where you have to look all
over the place for patches!)]
From: kenlong@netcom.com (Ken Long)
Subject: MyCard (C)
More simple than a pimple! All this does is put up an about box, from
scratch except for the 'ICN#' it uses, that resembles a business card.
When you click, it exits.
It uses a dotted zoomRect - similar to the Finder's - which appears to
come out of the Apple Menu, heads for center of the screen, keeps on
zoomin' to size, then the "card" materializes (if that's possible in
CyberSpace) within it. Kinda cool - so I decided to pass it along.
Got it from some old C source project I've been updating. More on that
later.
The actual built app. is very small. You could make them "Your Card" and
use them for "business cards" to introduce yourself via e-mail.
Maybe someone will modify it to show color icons. I could do it if I
wanted to fiddle with it some more, but the program it came from is a
higher priority. It would be easy and quick to do, at any rate.
Send "your card" with your e-mail address as the filename?
Enjoy!
-Ken-
[archived as: /ftp/pub/alt.sources.mac/mycard.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: PICT-ButtonCDEF (C)
Nothing unusual or spectacular about this CDEF. Just another picture
button control. But if you dump the ones with the labels, the "real"
picture one can be used as the basis for any number of picture button
needs. I've used it for tool palettes and tool bars. You just need to
change the sizes and the pictures and the 'CNTL' res.
Vet. programmers already know this, though.
-Ken-
[archived as: /ftp/pub/alt.sources.mac/pictbuttoncdef.cpt.hqx]
============================================================
From: ari@world.std.com (Ari I Halberstadt)
Subject: PopupCDEF-10b3-c.hqx (part 1 of 2)
This is version 1.0b3 of Popup CDEF. It fixes some bugs and has
slightly better support for menus created by the application. This
document is also new with version 1.0b3, and a new application is
provided to demonstrate the different types of popup menus that can be
created with this CDEF. Finally, a few extra features were added, such
as support for the popupFixedWidth variation code.
This CDEF implements a popup menu control. The CDEF handles display of
the menu's title, the current selection, the one pixel drop shadow,
and the down arrow at the end of the menu. It also handles tracking of
the mouse and checking and unchecking of the current item. It is
compatible with systems 6.0.5 and 7.0.
The CDEF is modeled after the popup CDEF provided by Apple in System
7.0 and described in IM-VI, p3-16 to 3-19. If you are already familiar
with that CDEF then using this CDEF will be very simple. Additional
support is provided for type-in popup menus and for menus created
dynamically by the application.
PopupCDEF is free, and includes complete source code in C and THINK C
5.0.4 project files.
[archived as: /ftp/pub/alt.sources.mac/popupcdef1.0b3.cpt.hqx]
============================================================
From: egurney@vcd.hp.com (Eddy J. Gurney)
Subject: Progress Bar CDEF (CDEF, C source, test app)
Attached is a compressed archive which contains the following:
. Progress Bar CDEF
. THINK C 6 source to Progress Bar CDEF
. THINK C 6 project file to make Progress Bar CDEF
. a sample application demonstrating the CDEF
. THINK C 6 source to the demo app
. Resources necessary to use the demo app
. THINK C 6 project file to make the demo app
It allows your app to provide a Progress Bar by simply adding a "CNTL"
item to any diaog, and then calling SetCtlValue() from your program. It
even has a bonus feature: If the CNTL's RefCon is '0' (it is by default),
then the standard Finder "Progress Bar" colors are used. If the CNTL's
RefCon is non-zero, then the custom colors in the CNTL's corresponding
'cctb' resource are used to draw the frame, "done" portion, and "to do"
portion. (This is described in a little more detail in the source file.)
It even works correctly with a Color QuickDraw Mac in 1-bit mode. (See
the comments in the source for more details. :-)
This is my first "released" CDEF. Therefore it is guaranteed to be
100% bug-free. BIG 8-) (It has been tested as rigorously as possible;
however, I haven't tried it on a machine without Color QuickDraw.)
E-mail comments, suggestions, requests to: egurney@vcd.hp.com
[archived as: /ftp/pub/alt.sources.mac/progresscdef1.0.cpt.hqx]
============================================================
From: egurney@vcd.hp.com (Eddy J. Gurney)
Subject: Update: Progress CDEFs (CDEF, TC6 source, test app)
This is an update to my "Progress Bar CDEF" I posted a couple days
ago. The demo application (included) shows a horizontal progress
bar, a verical progress bar that looks like a thermometer, and a
progress arc, so you can "dare to be different". :-)
Attached is a compressed archive which contains the following:
. Progress Bar CDEF v1.2, THINK C 6 source, TC6 project file
. Progress Arc CDEF v1.0, THINK C 6 source, TC6 project file
. Demo application, THINK C 6 source, resource file, TC6 project file
These CDEFs allow your app to provide a progress indicator by simply
adding a "CNTL" item to any dialog, and then calling SetCtlValue()
from your program. It has a bonus feature: if the CNTL's variation
code is "1", then the custom colors in the CNTL's corresponding 'cctb'
resource are used to draw the frame/"done"/"to do" areas. If the
variation code is "0", the standard "Finder progress bar" colors are
used. (This is described in the source file in a little more detail.)
The color progress bars should work just fine on Color QuickDraw Macs
in 1-bit mode. (See the comments in the source for more details. :-)
Change log:
1.1: First public release
1.2 changes:
. Call StripAddress() instead of &'ing off the lower 3 bytes
in calcCRgns (thanks Dave Polaschek).
. Now determine whether or not to use custom colors via the
variation code (thanks Steve LoBasso)
. Added capability to do vertical progress bars for
"thermometers". If the progress bar rectangle is taller than
it is wide, then the progress bar will fill "up" instead of
"across".
. Fixed a bug that prevented proper drawing when a control had
a non-zero minimum.
E-mail comments, suggestions, requests to: egurney@vcd.hp.com
[archived as: /ftp/pub/alt.sources.mac/progresscdef1.1.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: Stella Obscura.pas
The final John Calhoun source installment: Stella Obscura. The
stereoscopic (3-D) space arcade game.
-Ken-
[archived as: /ftp/pub/alt.sources.mac/stellaobscura.cpt.hqx]
============================================================
From: jwwalker@aol.com (JWWalker)
Subject: Text Item Dimming Source Code (C) v. 1.1
C source code for dimming text items (editText or statText) in dialogs.
When
dimmed, editText items become uneditable. True gray is used when possible.
Dimmed items update correctly, and no extra dialog items are needed.
By James W. Walker.
V. 1.1 fixes a few bugs and is modified for use with the universal headers.
[archived as: /ftp/pub/alt.sources.mac/textdim.cpt.hqx]
============================================================
From: ari@world.std.com (Ari I Halberstadt)
Subject: ThreadLib-10d4-c.hqx (part 1 of 3)
Many changes have been made from Thread Library 1.0d2 (the last fully
public release). This version fixes several bugs and improves the
internal operation of the Thread Library. See the "Version History"
file for a complete version history.
Thread Library implements nonpreemptive multiple thread execution
within a single application. It does not require any extensions,
should work with all Macintosh models (from the Plus on up), and works
with systems 6.0 (tested on 6.0.5) under Finder or MultiFinder, and
system 7.0. Thread Library compiles into a small library of around 2K,
so it won't add much overhead to your application. A simple test
application and THINK C project demonstrate how threads are used.
Another simple test application compares the speed of Thread Library
with the speed of Apple's Thread Manager. (Thread Library is 2-3 times
faster!) Best of all, the source code, entirely in C, is free.
Every thread has its own stack, and there are no restrictions on the
objects that can be allocated on a thread's stack. All other global
application data are shared by the threads. Context switches are very
efficient since they involve only a few operations to save the current
thread's state, followed by a longjmp to the new thread, and a few
instructions to restore the thread's state.
Thread Library was written using THINK C 5.0.4. Some minor changes may
be needed to port it to other compilers. All suggestions and enhancements
are welcome.
[archived as: /ftp/pub/alt.sources.mac/threadlib.cpt.hqx]
============================================================
From: Wayne K. Walrath (walrath@moose.cs.indiana.edu)
Subject: Tone Dialer Source
Dialer
(C) 1994 Wayne K. Walrath
Sample Source code for generating touch
tones through the Mac's speaker.
I threw this program together to test some code I translated from Pascal
to C, and decided to clean it up and send it to the archives since there
is always someone looking for tone dialing code. This was a three hour
hack, so don't expect too much from it; least of all elegant code.
The original Pascal source comes from DTS Tech Note TB 570 Sound Manger
Q&As. The author of the original Pascal source asked to be remembered
for all the headaches he suffered putting the snippet together, but
since his name doesn't appear anywhere in the TN, I'm unable to thank
him by name. Cheers to the unknown DTS'er!
I wrapped the tone dialing code inside the Zooming Windows source from
"Macintosh Programming Secrets" by Keith Rollin and Scott Knaster. The
source from MPS are available in all the usual Mac archives (like Sumex
and Umich). Definately a great book!
You may use portions of this code anyway you like, but you may not
charge money for the code as is. If you do something interesting with
it, I would enjoy hearing about it.
I welcome all comments and bug reports, though I'm not making
any promises of support for the Dialer. It was only intended to be a
learning tool. The author (that's me) accepts no liability for any
damage or loss of data caused by the use of this program.
I can be reached at the following addresses:
walrath@moose.cs.indiana.edu
AppleLink: wkw.rfe
Compuserve: 73243,3303
1 Mar 1994
Wayne Walrath
[archived as: /ftp/pub/alt.sources.mac/tonedialer.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: Trench Sim (C)
An old MegaMax C source (1985) I got off the net and made to run on Think
C.
I built the app. and tried to run it but got a type 4 error. MacsBug
said where it was, so I changed the divisor to 10000. May not be proper
but it worked. I'm still learning.
All this does is draw 6 perspective lines, giving the idea of the
"trench" on the Death Star, in Star Wars, then it changes their angles
wint mouse movement, so the viewpoint moves within the "trench." Of
course, the original was done on a 512, so with a bigger monitor in may
not operate as intended. But HEY! It's C source!
Enjoy!
kenlong@netcom.com
[archived as: /ftp/pub/alt.sources.mac/trenchsim.cpt.hqx]
============================================================
From: hay@cs.colorado.edu (David J. Hay)
Subject: UpDownArrow (C)
This is a project I put together in an effort to improve Eddy Gurney's
code by making the arrow more modular. It uses a set of four PICT
resources to draw the arrow, so the arrow can look however you like.
It was written in THINK C 5.0.4, but I suspect it shouldn't take many
modifications to run under other environments.
The Arrow Control may be used freely, without any restrictions. I do
ask that you let me know of any improvements you make to the code or
(gasp! :) bugs you might find by e-mailing me at <hay@cs.colorado.edu>
--David--
[archived as: /ftp/pub/alt.sources.mac/updnarrowcdef.cpt.hqx]
============================================================
From: egurney@vcd.hp.com (Eddy J. Gurney)
Subject: UpDownArrowTester Source
Here's an old program of mine (just now converted it to a Think C 6.0.1
project) that I wrote when I was first learning to program the Mac.
It attempts to implement the "up/down arrow bumpers" commonly seen in
the ColorPicker dialog. It's written completely as part of the event
handler, so it's not a nice little compact CDEF or anything. It uses
three PICT resources to represent the "off", "up" and "down" states, and
features variable speed increment/decrement (ie., the longer you hold it
down, the faster it goes, just like the ColorPicker, which as I said,
I was using as a model.)
I'm not claiming this is the right way to do it (probably far from
it!) but at least it's a start. If anyone makes improvements, etc.
let me know. (I don't care about any bugs in the "Tester" portion
of the code, just the part that handles the up/down arrows, which
is all I really cared about testing!)
If someone has a better implementation, I'd love to see it.
Regards,
Eddy
[archived as: /ftp/pub/alt.sources.mac/updncntl.cpt.hqx]
============================================================
From: kenlong@netcom.com (Ken Long)
Subject: UpDownArrows II
This is just Eddy Gurney's "Color Picker type" arrow project with a
couple modified version I did, with color buttons. I added two color
button 'PICT' sets - one is a colorized version of the B/W ones, and one
is the Mac window scroll arrows.
I figured as long as there's a 'dctb' res., may as well have color on the
buttons - what the hey!
-Ken-
[archived as: /ftp/pub/alt.sources.mac/updncntl2.cpt.hqx]
************************************************************
adjwindfkey FKEY source which adjusts a window
Matt Mora (mxmora@unix.sri.com)
FKEY source in C for adjusting a window.
appletalktoggle Assembler source to toggle AppleTalk
Charles B. Cranston (zben@ni.umd.edu)
Assembler source (well commented) for turning AppleTalk
on and off.
findfullpath Finding a pathname from a directory id
Michael A. Walker (walkerm@acf2.nyu.edu)
C function to determine the pathname from a directory id.
fswritete Using FSWrite with a TERec
Chuck Hoffman (chuck@gte.com)
Using text from a TERec structure with FSWrite.
getfindericon Finding the Finder's icon
E.J. Draper (utmdacc@odin.mda.uth.tmc.edu)
C snippet using PBDTGetIcon to get the Finder's icon.
loadcoderes Loading and calling a code resource
Kevin R. Boyce (boyce@lheavx.gsfc.nasa.gov)
C snippet for loading and calling a code resource.
loadcoderes2 Loading and calling a code resource
Mark Hanrek (markhanrek@aol.com)
Another example for loading and calling a code resource.
mycopybits Code and explanation for copybits
Eric Johnson (ejohnson@netcom.com)
Assembler code plus a long explanation for a faster
CopyBits.
paslibinsymc Instructions for including Pascal libs
Ingemar Ragnemalm (ingemar@lysator.liu.se)
Instructions for including Think Pascal libraries in
Symantec C/C++ projects.
polymaze Code for a maze routine
Ken Long (kenlong@netcom.com)
Replacement routine for the PolyMaze program that uses
predefined colors.
pswdfilter Password dialog filter routine
Peter N Lewis (peter@ncrpda.curtin.edu.au)
Pascal filter routine for password dialog boxes.
queenxlisp Algorithm for placing queens
Jean-Yves Terrien (terrien@cenatls.cena.dgac.fr)
Lisp routine for placing n queens on a chess board.
strptime Generic strptime routine
Kevin Ruddy (smiles@powerdog.com)
'strptime' code from un*x boxes.
timezonestuff Info for accessing time zone info
Pete Resnick (resnick@cogsci.uiuc.edu)
Info & code for accessing the Mac's time zone setting
tokenizer Using hidden ScriptMgr tokenizer
Matthew Xavier Mora (mxmora@unix.sri.com)
Code displaying the use of the Script Manager's hidden
tokenizing function.
************************************************************
Who's Who in Digest #4...
The contributors to this digest are:
Stefan Arentz (arentz@batcave.knoware.nl)
Kevin R. Boyce (boyce@lheavx.gsfc.nasa.gov)
Charles B. Cranston (zben@ni.umd.edu)
E.J. Draper (utmdacc@odin.mda.uth.tmc.edu)
Eddy J. Gurney (egurney@vcd.hp.com)
Ari I Halberstadt (ari@world.std.com)
Mark Hanrek (markhanrek@aol.com)
David J. Hay (hay@cs.colorado.edu)
Chuck Hoffman (chuck@gte.com)
Eric Johnson (ejohnson@netcom.com)
Peter N Lewis (peter@ncrpda.curtin.edu.au)
Ken Long (kenlong@netcom.com)
Matthew Xavier Mora (mxmora@unix.sri.com)
Ingemar Ragnemalm (ingemar@lysator.liu.se)
Pete Resnick (resnick@cogsci.uiuc.edu)
Kevin Ruddy (smiles@powerdog.com)
Matt Slot (fprefect@engin.umich.edu)
Jean-Yves Terrien (terrien@cenatls.cena.dgac.fr)
JW Walker (jwwalker@aol.com)
Jim Walker (walkerj@math.scarolina.edu)
Michael A. Walker (walkerm@acf2.nyu.edu)
Wayne K. Walrath (walrath@moose.cs.indiana.edu)
============================================================
Dave Nebinger dnebing@andy.bgsu.edu
Network Manager, Biology Dept. dnebing@opie.bgsu.edu
Bowling Green State University dnebing@bgsuopie (bitnet)
Bowling Green, OH 43403 #include <std_disclaimer.h>